<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title> - 钻石配置</title>
	    <meta name="keywords" content="">
	    <meta name="description" content="">
	    <link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	    <link href="__STATIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	    <link href="__STATIC__/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
	    <link href="__STATIC__/css/animate.css" rel="stylesheet">
	    <link href="__STATIC__/css/style.css?v=4.1.0" rel="stylesheet">
	    <link href="__STATIC__/css/new_file.css" rel="stylesheet">
	</head>
	<body class="gray-bg">
		<div class="wrapper wrapper-content  animated fadeInRight">
			<div class="row">
				<div class="col-sm-12">
					<div class="ibox ">
						<div class="ibox-title">
							<h5>蓝钻配置历史</h5>
						</div>
						<div class="toogl_body">
							<a href="Club.html"><button type="button" class="btn btn-w-m btn-bt btn-white">亲友圈管理</button></a>
							<a href="Club_configure.html"><button type="button" class="btn btn-w-m btn-info btn-bt">蓝钻商城配置</button></a>
							<a href="Club_goldcoin.html"><button type="button" class="btn btn-w-m btn-white btn-bt">黄钻商城配置</button></a>
							<a href="Club_vipcard.html"><button type="button" class="btn btn-w-m btn-white btn-bt">会员卡商城配置</button></a>
							<a href="Club_establish.html"><button type="button" class="btn btn-w-m btn-white btn-bt">创建亲友圈</button></a>
							<a href="Club_conf.html"><button type="button" class="btn btn-w-m btn-white btn-bt">亲友圈配置</button></a>
	                    	<hr style="clear: both;"/>
	                    	<a href="Club_configure.html"><button type="button" class="btn btn-w-m btn-white" >添加商品</button></a>
	                    	<a href="Club_configure_1.html"><button type="button" class="btn btn-w-m btn-info">历史记录</button></a>
							<div class="ibox-content ibox-jqGrid">
								<div class="form-group mmp-gbl"><br/>
	                                <label class="col-sm-2 control-dy">查询时间：</label>
	                                <div class="col-sm-8 form-time1">
	                                    <input type="text" placeholder="请输入查询时间段" class="form-control form-time-bk" id="time1" readonly="readonly"> 
	                                </div>
	                                <label class="col-sm-2 control-dy">商品ID：</label>
	                                <div class="col-sm-8 form-time1">
	                                    <input type="text" placeholder="请输入商品ID" class="form-control form-time-bk" id="goods_id"> 
	                                </div>
	                                <button type="button" id ="buttonid" class="btn btn-info">查询</button>
	                            </div>
		                        <div class="jqGrid_wrapper">
		                            <table id="table_list_1"></table>
		                            <div id="pager_list_1"></div>
		                        </div>
		                    </div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 修改  -->
		<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div id="gray_Nr">
				<div class="col-sm-6">
					<div class="ibox float-e-margins float-e-margins-2">
						<div class="ibox-title">
							<h5>提示消息</h5>
							<div class="ibox-tools" data-dismiss="modal">
								<a class="close-link">
									<i class="fa fa-times"></i>
								</a>
							</div>
						</div>
						<div class="panel-body">
							<div class="ibox float-e-margins float-e-border">
								<div class="ibox-content">
									<form class="form-horizontal">
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">商品ID：</label>
			                                <div class="col-sm-8">
			                                    <input type="text" value="56421" class="form-control" readonly="readonly" id="good_id">
			                                </div>
			                            </div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">商品位置：</label>
			                                <div class="col-sm-8">
			                                    <input type="text" value="56421" class="form-control" readonly="readonly" id="goods_position">
			                                </div>
			                            </div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">钻石数量：</label>
			                                <div class="col-sm-8">
			                                    <input type="text" value="56421" class="form-control" readonly="readonly" id="number_diamonds">
			                                </div>
			                            </div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">价格：</label>
			                                <div class="col-sm-8">
			                                    <input type="text" value="56421" class="form-control" readonly="readonly" id="price">
			                                </div>
			                            </div>
			                             <div class="form-group">
			                                <label class="col-sm-2 control-label">开启时间：</label>
			                                <div class="col-sm-8">
			                                    <select class="form-control form-consele1" disabled="disabled" id="time">
												   <option value="0">永久</option>
												   <option value="1">限时</option>
												</select>
			                                    <input type="text" class="form-control clo-sj" readonly="readonly" id="start_time">
			                                </div>
			                            </div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">销售库存：</label>
			                                <div class="col-sm-8">
			                                    <select class="form-control form-consele2" disabled="disabled" id="inventory">
												   <option value="0">不限</option>
												   <option value="1">限量</option>
												</select>
			                                    <input type="text" class="form-control clo-xl" readonly="readonly" id ="sales_inventory">
			                                </div>
			                            </div>
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">是否热卖：</label>
			                                <div class="col-sm-8">
			                                    <select class="form-control form-consele" disabled="disabled" id ="exclusive">
												   <option value="0">否</option>
												   <option value="1">是</option>
												</select>
			                                </div>
			                            </div>
			                            <!--<div class="form-group">-->
			                                <!--<label class="col-sm-2 control-label"></label>-->
			                                <!--<div class="col-sm-8">-->
			                                    <!--<input type="text" class="form-control clo-xl2s" placeholder="亲友圈id用“，”分割" id="club_id" readonly="readonly">-->
			                                <!--</div>-->
			                            <!--</div>-->
			                        </form>
								</div>
							</div>
							<div class="ibox-butz">
								<input class="btn btn-w-m btn-info" type="button" value="确定">
								<input class="btn btn-w-m" type="button" data-dismiss="modal" value="取消">
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--修改 end-->
<!--手机导航-->
<div class="to-fdh" style="display: none;">
	<img class="to-imgd" src="__STATIC__/img/phonedh.jpg">
	<div class="mob-nrlb">
		<ul>
			<li>
				<a class="mob-nrdh">管理</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('Player/gameplayer')}">玩家管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('system/notice')}">公告管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('email/mail')}">邮件管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Club/club')}">亲友圈管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Money/money')}">提现管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('Order/order')}">订单管理</a>
					</li>
				</ul>
			</li>
			<li>
				<a class="mob-nrdh">数据</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('data/datagk')}">概況</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datawf')}">玩法</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datalc')}">留存</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/datass')}">实时数据</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/dataczfx')}">充值分析</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/dataclub')}">亲友圈统计</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/president')}">高级会长</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('data/regionaldata')}">地区数据</a>
					</li>
				</ul>
			</li>
			<li>
				<a class="mob-nrdh mob-qbh">权限</a>
				<ul class="mob-nryc">
					<li class="mob-nrdhli">
						<a href="{:url('rule/rule_list')}">权限管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('rule/rule_group')}">用户组管理</a>
					</li>
					<li class="mob-nrdhli">
						<a href="{:url('account/account_details')}">后台账号管理</a>
					</li>
				</ul>
			</li>
		</ul>
	</div>
</div>
<div id="zkbg">
	<img src="__STATIC__/img/dp.gif">
</div>
<div class="vnl-zz" style="display:none">
	<div><img src="__STATIC__/img/bqhp.gif"></div>
</div>
<!--手机适配-->
	    <script src="__STATIC__/js/jquery.min.js?v=2.1.4"></script>
	    <script src="__STATIC__/js/bootstrap.min.js?v=3.3.6"></script>
	    <script src="__STATIC__/js/plugins/peity/jquery.peity.min.js"></script>
	    <script src="__STATIC__/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
	    <script src="__STATIC__/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
	    <script src="__STATIC__/js/content.js?v=1.0.0"></script>
    	<script src="__STATIC__/js/plugins/laydate/laydate.js"></script>
		<script>
		
            //手机适配
            $(function(){
                if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
                    $("head").append("<link>");
                    var css = $("head").children(":last");
                    css.attr({
                        rel:  "stylesheet",
                        type: "text/css",
                        href: "__STATIC__/css/phone_sp.css"
                    });
                    var mql = window.matchMedia("(orientation: portrait)");
                    if(mql.matches) { //竖屏样式
                        $(".vnl-zz").show();
                        $(".to-fdh").hide();
                    }else{
                        $(".to-fdh").show();
                        $("html").width("100%");
                        $("body").width("100%");
                    }
                    mql.addListener(function(m) {
                        if(m.matches) {
                            // 改变到直立方向
                            $(".vnl-zz").show();
                            $(".to-fdh").hide();
                        }
                        else {
                            $(".to-fdh").show();
                            $(".vnl-zz").hide();
                            $("html").width("100%");
                            $("body").width("100%");
                        }
                    });
                }
            });
            //导航显示展开
            $(".mob-nrdh").click(function(){
                $(this).next().toggle(".mob-nryc");
            });
            $(".to-imgd").click(function(){
                $(this).next().toggle(".mob-nrlb");
            });
            //手机适配end
		function President_details(t){
            var id = $(t).parent().parent().children().eq(4).html();//亲友圈id
			var goods_id = $(t).parent().parent().children().eq(1).html();//亲友圈id
			    $.ajax({
					type: "post",
					url: "__URL__/President_details",
					data: {
                        'id':id,
						'goods_id':goods_id,
                        'goods_type':10001
					},
					dataType: "json",
					success: function(e) {
						console.log(e.d_goods_id);
						var time = e.start_time+ '-' +e.end_time;
						var price = e.price/100;
						$('#good_id').val(e.goods_id);
						$('#goods_position').val(e.goods_position);
						$('#number_diamonds').val(e.number);
						$('#price').val(price);
						
						if(e.start_time == null){
							var time_limit= $('#time').val(0);
							time_limit.attr("selected", "selected");
							$('.clo-sj').hide();
							$('#start_time').val();
						}else{
							var time_limit= $('#time').val(1);
							time_limit.attr("selected", "selected");
							$('.clo-sj').show();
							$('#start_time').val(time);
						}
						if(e.sales_inventory == -1){
							var inventory= $('#inventory').val(0);
							inventory.attr("selected", "selected");
							$('.clo-xl').hide();
							$('#sales_inventory').val();
						}else{
							var inventory= $('#inventory').val(1);
							inventory.attr("selected", "selected");
							$('.clo-xl').show();
							$('#sales_inventory').val(e.sales_inventory);
						}

                        if(e.hot_sale == 0){
                            var exclusive_goods= $('#exclusive').val(0);
                            exclusive_goods.attr("selected", "selected");
                            $('#club_id').hide();
                            $('#club_id').val();
                        }else{
                            var exclusive_goods= $('#exclusive').val(1);
                            exclusive_goods.attr("selected", "selected");
                            $('#club_id').show();
                            $('#club_id').val(e.club_id);
                        }

					},
					error: function(e) {
					}
				});
		}
		 $('#buttonid').on('click', function() {     //页面上的button按钮的click事件，重新获取参数后发送参数，然后重新加载数据。
                var Data ={
                    time:$("#time1").val(),
                    goods_id:$("#goods_id").val(),
                };
                $("#table_list_1").jqGrid('setGridParam',{
                    url:'__URL__/President_operations',
                    datatype:'json',
                    postData:{
                    'time':Data.time,
                    'goods_id':Data.goods_id,
                    'goods_type':10001
                    },
                    page:1
                }).trigger("reloadGrid"); //重新载入

        });
        $(document).ready(function () {

			$('.clo-sj').hide();
			$('.clo-xl').hide();
        	$('.form-consele1').on('change',function(){
        		if ($('.form-consele1').val() == '0') {
        			$('.clo-sj').hide();
        		} else{
        			$('.clo-sj').show();
        		}
        	});
        	$('.form-consele2').on('change',function(){
        		if ($('.form-consele2').val() == '0') {
        			$('.clo-xl').hide();
        		} else{
        			$('.clo-xl').show();
        		}
        	});
            $.jgrid.defaults.styleUI = 'Bootstrap';

            $("#table_list_1").jqGrid({
                datatype:'json',
                postData:{}, //发送数据
                mtype: 'POST',
                height: 450,
                autowidth: true,
                shrinkToFit: true,
                rowNum: 20,
                rowList: [20,50,100],
                colNames: ['修改时间', '商品ID', '操作人', '操作类型', 'id','商品详情'],
                colModel: [
                    {
                        name: 'opera_time',
                        index: 'opera_time',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
                        name: 'goods_id',
                        index: 'goods_id',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
                        name: 'opera_pepole',
                        index: 'opera_pepole',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
                        name: 'opera_type',
                        index: 'opera_type',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        align:'center'
                    },
                    {
                        name: 'id',
                        index: 'id',
                        width: 60,
                        sorttype: "int",
                        sortable: false,
                        hidden :true,
                        align:'center'
                    },
                    {
						name: 'opera_type',
						index: 'opera_type',
						width: 60,
						formatter: function(opera_type) {
							// if(opera_type == "商品删除"){
							// 	return '商品已被删除,无法查看商品详情';
							// }else{
								return '<input type="button" value="详情" id="" data-toggle="modal" data-target="#myModal" class="btn btn-info" onclick="President_details(this)"/>';
							// }
							
						},
                        align:'center'
					}
                ],
                pager: "#pager_list_1",
                viewrecords: true,
                loadonce: true,
                caption: "钻石配置历史记录",
                hidegrid: false
            });
			
            
			setTimeout(function(){
                var width = $('.jqGrid_wrapper').width();
                $('#table_list_1').setGridWidth(width);
			},500);
            
            
            
		    laydate.render({
		      elem: '#time1'
		      ,range: true
		    });
		    laydate.render({
		      elem: '#time2'
		      ,range: true
		    });
        });
    </script>


	</body>

</html>